import { get, post } from '@/utils/https';
console.log('post', post);
// 查询推荐列表
export function getRecommendListApi(data) {
  return new Promise((resolve, reject) => {
    post(PERFORM_URL + '/tbagentinfo/get_recommended_page',
      data,
      res => {
        resolve(res);
      },
      err => {
        reject(Message.error(err.message));
      }
    );
  });
}
// 查询员工列表
export function getStaffListApi(data) {
  return new Promise((resolve, reject) => {
    post(PERFORM_URL + '/tbagentinfo/query_tbagentinfo_page',
      data,
      res => {
        resolve(res);
      },
      err => {
        reject(Message.error(err.message));
      }
    );
  });
}
// 营业区下拉options
export function getRegionOptionAPi(arg = 'fen1') {
  return new Promise((resolve, reject) => {
    post(PERFORM_URL + '/dict/agency/region',
      {
        'code': arg
      },
      res => {
        resolve(res);
      },
      err => {
        reject(Message.error(err.message));
      }
    );
  });
}
// 营业部下拉 options
export function getDeptOptionAPi(arg = 'zong') {
  return new Promise((resolve, reject) => {
    post(PERFORM_URL + '/dict/agency/dept',
      {
        'code': arg
      },
      res => {
        resolve(res);
      },
      err => {
        reject(Message.error(err.message));
      }
    );
  });
}
// 查询代理人
export function getAgencyAPi(data) {
  return new Promise((resolve, reject) => {
    post(PERFORM_URL + '/tbagentinfo/get_recommended_page',
      {
        parentCode: data
      },
      res => {
        resolve(res);
      },
      err => {
        reject(Message.error(err.message));
      }
    );
  });
}
// 删除
export function deletePersonAPi(data) {
  return new Promise((resolve, reject) => {
    post(PERFORM_URL + '/tbagentinfo/delete_personnelinformationids',
      {
        ids: data
      },
      res => {
        resolve(res);
      },
      err => {
        reject(Message.error(err.message));
      }
    );
  });
}

